import _00GraphFuc as gf
import _000GraphBasicProblem as gb

#11.3.3求关键通路
V={0,1,2,3,4,5}
E={(0,1),(0,2),(0,3),(1,2),(1,4),(2,3),(2,5),(3,4),(3,5),(4,5)}
Ew={(1,0,1),(3,0,2),(5,0,3),(1,1,2),(2,1,4),(1,2,3),(2,2,5),(1,3,4),(3,3,5),(2,4,5)}
gf.drawdigraph(E)
[d,di,do]=gb.degreesetw(V,Ew)
v0,vn=0,5
[Pc,Hx,Hy]=gb.craticalpath(V,Ew,di,do,v0,vn)
#[V,Ec]=gb.graphw2graph(V,Pc)
#gg.drawdigraph(Ec)
print("Hx",Hx)
print("Hy",Hy)
print(Pc)